<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:composite="http://java.sun.com/jsf/composite">

    <h:head>
        <f:loadBundle basename="com.brain.core.i18n.ApplicationResources" var="message" />
        <title><h:outputText value="#{message['general.cabecera.titulo.aplicacion']}"/></title>            
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/recursos/css/default.css" />
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/recursos/css/theme.css" />
        <script type="text/javascript" src="#{request.contextPath}/recursos/js/script.js" /> 
    </h:head>

    <composite:interface>    

    </composite:interface>
    <composite:implementation>                 
            <h:form onsubmit="return checkSubmit();"  id="frmPrincipalUbigeo">    
                 <p:contextMenu for="treeSingle" rendered="#{sessionMBean.accion != applicationMBean.ver}">  
                        <p:menuitem value="#{i18n['empresa.ubigeo.cambiar.seleccionado']}" actionListener="#{empresaMBean.agegarEliminarUbigeoPais}" icon="ui-icon-refresh"  style="#{applicationMBean.estiloMenu}"
                                    ajax="true"
                                    update="treeSingle :frmMenuBar:mbarPrincipal, :msgs"/>  
                  </p:contextMenu>  
                <h:panelGrid id="idPngTree">
                    <p:treeTable id="treeSingle" value="#{ubigeoMBean.ubigeos}" var="dtoU" 
                                 selectionMode="single"   styleClass="estiloPanel"
                                 selection="#{empresaMBean.selectedUbigeo}">
                        <p:column style="#{dtoU.matiz}" rendered="#{dtoU.tipo == 'PAIS' or dtoU.tipo == null}">   
                            <f:facet name="header">  
                                #{i18n['general.label.id']}  
                            </f:facet>  
                            <h:outputText value="#{dtoU.id}"/>  
                        </p:column>  
                        <p:column style="#{dtoU.matiz}" rendered="#{dtoU.tipo == 'PAIS' or dtoU.tipo == null}">  
                            <f:facet name="header">  
                                #{i18n['ubigeo.descripcion']}  
                            </f:facet>  
                            <h:outputText value="#{dtoU.descripcion}" />  
                        </p:column> 
                        <p:column style="#{dtoU.matiz}" rendered="#{dtoU.tipo == 'PAIS' or dtoU.tipo == null}">  
                            <f:facet name="header">  
                                #{i18n['ubigeo.tipo']}  
                            </f:facet>  
                            <h:outputText value="#{dtoU.tipo}" />  
                        </p:column>
                        <p:column style="#{dtoU.matiz}" rendered="#{dtoU.tipo == 'PAIS' or dtoU.tipo == null}">  
                            <f:facet name="header">  
                                #{i18n['ubigeo.codigo.postal']}  
                            </f:facet>  
                            <h:outputText value="#{dtoU.codigoPostal}" />  
                        </p:column>
                        <p:column style="#{dtoU.matiz}" rendered="#{dtoU.tipo == 'PAIS' or dtoU.tipo == null}">  
                            <f:facet name="header">  
                                #{i18n['empresa.ubigeo.estado']}  
                            </f:facet>  
                            <p:selectBooleanCheckbox value="#{dtoU.seleccionadoEmpresa}"  disabled="true" rendered="#{dtoU.tipo == 'PAIS'}"/> 
                        </p:column>

                    </p:treeTable>
                </h:panelGrid>

            </h:form>
      </composite:implementation>

</html>